<!-- detail.html -->
{% load static %}
<!DOCTYPE html>
<html>
<head>
    <title>投票详情</title>
    <link rel="stylesheet" href="{% static 'polls/style.css' %}">
</head>
<body>
    <div class="container">
        <div class="poll-card">
            <div class="poll-header">
                <h1>{{ question.question_text }}</h1>
            </div>
            <p class="vote-instruction">请选择一个选项并提交您的投票。</p>
            <form action="{% url 'polls:vote' question.id %}" method="post">
                {% csrf_token %}
                <div class="options-list">
                    {% for choice in question.choice_set.all %}
                    <div class="option-item">
                        <label>
                            <input type="radio" name="choice" value="{{ choice.id }}">
                            <span class="radio-circle"></span>
                            {{ choice.choice_text }}
                        </label>
                    </div>
                    {% endfor %}
                </div>

                {% if error_message %}
                <div class="error-msg">
                    {{ error_message }}
                </div>
                {% endif %}

                <div class="form-actions">
                    <input type="submit" value="提交投票" class="submit-btn">
                    <a href="{% url 'polls:index' %}" class="back-btn">返回列表</a>
                </div>
            </form>
        </div>
    </div>
</body>
</html>